﻿namespace MLog.Core {
    public abstract class BaseFilter<T> : Filter<T> {
        public virtual void ApplyConfig(Node config) {
            var child = config.Child;
            if (child != null)
                for (var i = 0; i < child.Count; i++) {
                    var n = child[i];
                    if (!CustomApply(n)) {
                        var info = LoggerConfiguration.GetPropertyName(GetType(), n);
                        info.SetValue(this, n.Value, null);
                    }
                }
        }

        protected virtual bool CustomApply(Node property) {
            return false;
        }
    }
}